package com.cf.chat.client;
import java.io.*;
import java.net.Socket;
/**
 * @Auther: chenf
 * @Date: 2020/07/28/14:45
 * @Description:客户端
 */
public class Client {
    public static void main(String[] args) throws IOException {
        // 1.创建Socket对象
        Socket client = new Socket("localhost",9999);
        // 2.创建发送的线程类对象
        Send send = new Send(client);
        // 3.创建接收的线程类对象
        Receive receive = new Receive(client);
        // 4.创建Thread类对象并启动线程
        Thread sendThread = new Thread(send);
        sendThread.start();
        Thread receiveThread = new Thread(receive);
        receiveThread.start();
        System.out.println("欢迎登录！");
    }
}
